package org.zxp.thread.testsynchronized;

/**
 * @program: zxp-thread-test
 * @description: javap -v Test1 查看反编译内容 synchronized
 * @author: X-Pacific zhang
 * @create: 2019-05-09 16:33
 **/
public class Test1 {
    private static int index = 0;

    public void add1(){
        index++;
    }
    public synchronized void add2(){
        index++;
    }
    public void add3(){
        synchronized (this) {
            index++;
        }
    }

    public void add4(){
        Test1 test1 = new Test1();
    }
}
